using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class vPhysicianAmountMap : EntityTypeConfiguration<vPhysicianAmount>
    {
        public vPhysicianAmountMap()
        {
            // Primary Key
            this.HasKey(t => new { t.invno, t.Doctor });

            // Properties
            this.Property(t => t.invno)
                .IsRequired()
                .HasMaxLength(8);

            this.Property(t => t.Doctor)
                .IsRequired()
                .HasMaxLength(35);

            // Table & Column Mappings
            this.ToTable("vPhysicianAmount");
            this.Property(t => t.invno).HasColumnName("invno");
            this.Property(t => t.Doctor).HasColumnName("Doctor");
            this.Property(t => t.Guarantor1_Physiciantotal).HasColumnName("Guarantor1_Physiciantotal");
            this.Property(t => t.Guarantor2_Physiciantotal).HasColumnName("Guarantor2_Physiciantotal");
            this.Property(t => t.Physician_Amount).HasColumnName("Physician Amount");
            this.Property(t => t.Guarantor1_Physician_Amount_).HasColumnName("Guarantor1 Physician Amount ");
            this.Property(t => t.Guarantor2_Physician_Amount_).HasColumnName("Guarantor2 Physician Amount ");
        }
    }
}
